# -*- encoding: utf-8 -*-
'''
@File    :   BasicException.py
@Time    :   2023/02/13 15:24:51
@Author  :   hgy_rick
@Description : 
'''

class InvalidArgumentException(Exception):
    def __init__(self, *args, **kwargs):
        # Python 3 base exception doesn't have "message" anymore, only args.
        # We restore it here for convenience.
        self.message = args[0] if len(args) >= 1 else "Arguments input are invalid, please check!"
        super(Exception, self).__init__(*args, **kwargs)


class NotEnoughDataException(Exception):
    def __init__(self, size, at_least=None):
        super(Exception, self).__init__()        
        if at_least:
            self.message = 'data size {} is not enough, at least {}'.format(size, at_least)
        else:
            self.message = 'data size {} is not enough!'.format(size)

class ExpectEqualException(Exception):
    def __init__(self, *args: object) -> None:
        super().__init__(*args)
        self.message = args[0] if len(args) >= 1 else ""
        if len(args) == 2:
            self.message = "expect {} = {}, but not!".format(*args)
            

